package com.flynn.rock.system.repository;

import com.flynn.rock.system.entity.SysUserAccountEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface SysUserAccountRepository extends JpaRepository<SysUserAccountEntity, Long> {

    @Query("from SysUserAccountEntity as t where t.account = :account")
    SysUserAccountEntity selectByUsername(@Param("account") String account);

    void deleteAllByUserId(Long userId);
}
